<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/home/include/init_home.jsp" %>
<%
	String block_yn		= StringUtil.nvl(request.getParameter("block_yn"));
	String air_code		= StringUtil.nvl(request.getParameter("air_code"));

	HashMap param = new HashMap();
	param.put("block_yn", block_yn);
	param.put("air_code", air_code);


	HomeDAO dao = new HomeDAO();

	HashList air	= dao.selectAir(param);
	HashList list 	= dao.selectAirList(param);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%= HOME_NAME %></title>
<link href="../css/home.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/common2.js"></script>
<script>
	function fnShowNotice(air_id) {
		$('.popup').addClass('hidden');
		$('#air_notice'+air_id).removeClass('hidden');
	}

	function fnHideNotice() {
		$('.popup').addClass('hidden');
	}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <%@ include file="/home/include/top_menu.jsp" %>
  <tr>
    <td valign="top" align="center" class="sub_con"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
      <!-- 좌측 네비 시작-->
        <%@ include file="/home/include/left_menu.jsp" %>
        <!-- 좌측 네비 끝-->
        <td width="50"></td>
        <!-- 컨텐츠 시작-->
        <td valign="top" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="../images/sub/<%=pmenu_id %>_title_01.gif" alt="할인항공"  /><img src="../images/sub/<%=pmenu_id %>_title_sub.gif"  /></td>
                <td align="right" valign="bottom"></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="5"><img src="../images/sub/sub_line.gif" width="723" height="5" /></td>
          </tr>
          <tr>
            <td height="30"></td>
          </tr>
          <tr>
            <td class="sub_title"><%= menu_name %></td>
          </tr>
          <tr>
            <td height="30"></td>
          </tr>
          <!--항공표 시작-->
          <tr>
          	<td><table  border="0" cellspacing="0" cellpadding="0">
          	  <tr>
          	    <td width="111"><a href="./airList.jsp?pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id %>&block_yn=<%=block_yn%>"><img src="../images/sub/03_tab_01_<%=air_code.equals("") ? "on" :"off" %>.gif" alt="전체" width="111" height="30" /></a></td>
          <% for (int i = 0; i < air.size(); i++) {
          		String on = air_code.equals(air.get("air_code",i)) ? "on" : "off";
          %>
          	    <td><a href="./airList.jsp?pmenu_id=<%=pmenu_id%>&menu_id=<%=menu_id %>&block_yn=<%=block_yn%>&air_code=<%=air.get("air_code",i) %>"><img src="../images/sub/03_tab_<%= air.get("air_code",i) %>_<%=on %>.gif" alt="<%= air.get("air_name",i) %>" /></a></td>
          <% } %>
        	    </tr>
        	  </table></td>
          </tr>
          <tr>
          	<td valign="top" bgcolor="#2b2b2e"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          	  <tr>
          	    <td width="15"></td>
          	  </tr>
              <tr>
                <td valign="top" bgcolor="#2b2b2e">
				<%	if ("Y".equals(block_yn)) {	%>
        			<table id="air_list"  width="100%" border="0" cellspacing="0" cellpadding="0" style="border:4px solid #2b2b2e">
                   	  <tr height="37">
                   	  	<th align="center"><img src="../images/sub/sub3_f_01.gif" alt="항공사"  /></th>
          	            <th width="100" align="center"><img src="../images/sub/sub3_f_tab_01.gif" alt="출발일"  /></th>
          	            <th width="100" align="center"><img src="../images/sub/sub3_f_tab_02.gif" alt="도착일"  /></th>
          	            <th width="80" align="center"><img src="../images/sub/sub3_f_tab_03.gif" alt="기간"  /></th>
          	            <th width="80" align="center"><img src="../images/sub/sub3_f_tab_04.gif" alt="가능좌석"  /></th>
          	            <th width="100" align="center"><img src="../images/sub/sub3_f_tab_05.gif" alt="항공료"  /></th>
          	            <th width="80" align="center"><img src="../images/sub/sub3_f_tab_06.gif" alt="규정" /></th>
                   	  </tr>
       	         <% for (int i = 0; i < list.size(); i++) {	%>
					  <tr height="36">
                         <td ><img src="../images/sub/03_ico_<%= list.get("air_code",i) %>.gif" alt="<%= list.get("air_name",i) %>" align="absmiddle"/>
                        	<%= list.get("air_name",i) %></td>
                         <td ><%= StringUtil.toDate(list.get("from_date", i)) %></td>
						 <td><%= StringUtil.toDate(list.get("to_date", i)) %></td>
                         <td><%= list.get("start_day",i) %></td>
                         <td><%= list.get("seat_count",i) %></td>
                         <td>\<%= StringUtil.toPrice(list.get("sales_price",i)) %></td>
                         <td>
                         	<a href="#nohref" onclick="fnShowNotice(<%= list.get("air_id",i) %>)"><img src="../images/sub/sub3_view_btn.gif"/></a>
                         	<div id="air_notice<%= list.get("air_id",i) %>" class="popup hidden">
                         		<div class="content">
                         		<%= list.get("air_notice",i) %>
                         		</div>
                         		<div style="text-align:right; padding-right:20px">
                         			<a href="#nohref" onclick="fnHideNotice()">close</a>
                         		</div>
                         	</div>
                         </td>
                   	 </tr>
       			<%	}	 %>
       				</table>
				<%	} else {	%>
					<table id="air_list" width="100%" border="0" cellspacing="0" cellpadding="0" style="border:4px solid #2b2b2e">
                   	  <tr height="37">
                   	  	<th align="center"><img src="../images/sub/sub3_f_01.gif" alt="항공사"  /></th>
          	            <th width="80" align="center"><img src="../images/sub/sub3_f_tab_07.gif" alt="경유"  /></th>
          	            <th width="180" align="center"><img src="../images/sub/sub3_f_tab_09.gif" alt="출발기간"  /></th>
          	            <th width="110" align="center"><img src="../images/sub/sub3_f_tab_10.gif" alt="출발요일"  /></th>
          	            <th width="100" align="center"><img src="../images/sub/sub3_f_tab_05.gif" alt="할인항공료"  /></th>
          	            <th width="100" align="center"><img src="../images/sub/sub3_f_tab_06.gif" alt="규정" /></th>
          	          </tr>
          	   <% for (int i = 0; i < list.size(); i++) {	%>
          	   		  <tr height="36">
          	            <td >
                        	<img src="../images/sub/03_ico_<%= list.get("air_code",i) %>.gif" alt="<%= list.get("air_name",i) %>" align="absmiddle"/>
                        	<%= list.get("air_name",i) %>
                        </td>
                        <td ><%= list.get("air_type_name",i) %></td>
                        <td ><%= StringUtil.toDate(list.get("from_date", i)) %> ~ <%= StringUtil.toDate(list.get("to_date", i)) %></td>
                        <td><%= list.get("start_day",i) %></td>
                        <td>\<%= StringUtil.toPrice(list.get("sales_price",i)) %></td>
                        <td>
                        	<a href="#nohref" onclick="fnShowNotice(<%= list.get("air_id",i) %>)"><img src="../images/sub/sub3_view_btn.gif"/></a>
                        	<div id="air_notice<%= list.get("air_id",i) %>" class="popup hidden">
                        		<div class="content">
                        		<%= list.get("air_notice",i) %>
                        		</div>
                        		<div style="text-align:right; padding-right:20px">
                        			<a href="#nohref" onclick="fnHideNotice()">close</a>
                        		</div>
                        	</div>
                        </td>
                      </tr>
                <%	} %>
                		</table>
                		<script>
				            	func_row_merge_Item(air_list, 1, 2);
				            	func_row_merge_Item(air_list, 1, 1);
				            	func_row_merge_Item(air_list, 1, 0);
				            </script>
				<%	}	%>


				</td>
           	</tr>
           	</table>
          </td>
          </tr>
          <!--항공표 끝-->
          <tr>
            <td height="80"></td>
          </tr>

        </table></td>
        <!-- 컨텐츠 끝-->
      </tr>
    </table></td>
  </tr>
  <%@ include file="/home/include/footer.jsp" %>
</table>
</body>
</html>
